import 'package:basic_common/common_exports.dart';
import 'package:basic_modle/upload_data.dart';
import 'package:basic_modle/version_data.dart';
import 'package:dio/dio.dart';
import 'http.dart';
import 'http_url.dart';

/// 接口请求
class ApiService {
// 静态私有成员，没有初始化
  static ApiService? _instance;

  // 私有构造函数  // 初始化
  ApiService._internal();

  ///工厂构造函数， 工厂模式 : 单例公开访问点
  factory ApiService() => _instance ?? ApiService._internal();

  /// 申请证书
  Future<HttpData> getSignCa(
      {dynamic data,
      bool isShowLoading = true,
      String loadingTitle = '加载中...'}) async {
    HttpData httpData = await Http.post(
      HttpUrl.SIGN_GET_CA,
      data: data,
      isShowLoading: isShowLoading,
      loadingTitle: loadingTitle,
    );
    return httpData;
  }

  /// 获取激活码
  Future<HttpData> getActivaCode(
      {dynamic data,
      bool isShowLoading = false,
      String loadingTitle = '加载中...'}) async {
    HttpData httpData = await Http.post(
      HttpUrl.CA_ACTIVA_CODE,
      data: data,
      isShowLoading: isShowLoading,
      loadingTitle: loadingTitle,
    );
    return httpData;
  }

  /// CA 认证 协同获取签名认证
  Future<HttpData> getCaAuthInfo(
      {dynamic data,
      bool isShowLoading = false,
      String loadingTitle = '加载中...'}) async {
    HttpData httpData = await Http.post(HttpUrl.CA_AUTH_URL,
        data: data, isShowLoading: isShowLoading, loadingTitle: loadingTitle);
    return httpData;
  }

  /// 登录接口
  Future<HttpData> loginReq(
      {dynamic data,
      bool isShowLoading = true,
      String loadingTitle = '加载中...'}) async {
    HttpData httpData = await Http.post(HttpUrl.LOGIN_URL,
        data: data, isShowLoading: isShowLoading, loadingTitle: loadingTitle);
    return httpData;
  }

  // 获取短信验证码
  Future<HttpData> smsReq(
      {dynamic data,
      bool isShowLoading = false,
      String loadingTitle = '加载中...'}) async {
    HttpData httpData = await Http.post(HttpUrl.SMS_CODE_URL,
        data: data, isShowLoading: isShowLoading, loadingTitle: loadingTitle);
    return httpData;
  }

  /// 校验手机号和验证码
  Future validSmsCode(
      {dynamic data,
      bool isShowLoading = false,
      String loadingTitle = '加载中...'}) async {
    HttpData httpData = await Http.post(HttpUrl.VALID_SMS_CODE_URL,
        data: data, isShowLoading: isShowLoading, loadingTitle: loadingTitle);
    return httpData;
  }

  /// 注册
  Future<HttpData> register(
      {dynamic data,
      bool isShowLoading = false,
      String loadingTitle = '加载中...'}) async {
    HttpData httpData = await Http.post(HttpUrl.REGISTER_URL,
        data: data, isShowLoading: isShowLoading, loadingTitle: loadingTitle);
    return httpData;
  }

  /// 获取医生信息
  Future<HttpData> drProfile(
      {dynamic data,
      bool isShowLoading = false,
      String loadingTitle = '加载中...'}) async {
    HttpData httpData = await Http.post(HttpUrl.PROFILE_URL,
        data: data, isShowLoading: isShowLoading, loadingTitle: loadingTitle);
    return httpData;
  }

  /// 新增医生实名认证
  Future<HttpData> drRealName(
      {dynamic data,
      bool isShowLoading = true,
      String loadingTitle = '加载中...'}) async {
    HttpData httpData = await Http.post(HttpUrl.DR_REALNAME_URL,
        data: data, isShowLoading: isShowLoading, loadingTitle: loadingTitle);

    return httpData;
  }

  /// 上传单图
  Future<UploadData> uploadSingle(
      {dynamic params,
      isShowLoading = false,
      loadingTitle = "加载中...",
      String baseUrl = ""}) async {
    UploadData uploaddata = await Http.postForm(HttpUrl.UPLOAD_IMG_URL,
        data: params,
        isShowLoading: isShowLoading,
        loadingTitle: loadingTitle,
        baseUrl: baseUrl);
    return uploaddata;
  }

  /// 首页-统计数据
  Future<HomeStatisData> getHomeStatis(
      {dynamic data,
      bool isShowLoading = false,
      String loadingTitle = '加载中...'}) async {
    HttpData httpData = await Http.post(HttpUrl.HOME_STATIS_URL,
        data: data, isShowLoading: isShowLoading, loadingTitle: loadingTitle);
    if (httpData.code == 1) {
      HomeStatisData statisData = HomeStatisData.fromJson(httpData.data);
      return statisData;
    }
    return HomeStatisData();
  }

  /// 获取 版本信息
  Future<VersionData> getVersion(
      {dynamic data,
      String? baseUrl,
      bool isShowLoading = false,
      String loadingTitle = '加载中...'}) async {
    HttpData httpData = await Http.post(HttpUrl.VERSION_URL,
        data: data,
        isShowLoading: isShowLoading,
        loadingTitle: loadingTitle,
        baseUrl: baseUrl);
    if (httpData.code == 1) {
      VersionData versionData = VersionData.fromJson(httpData.data);
      return versionData;
    }
    return VersionData();
  }

  /// 获取医院列表
  Future<HttpData> getHospitalList(
      {dynamic data,
      bool isShowLoading = false,
      String loadingTitle = '加载中...'}) async {
    HttpData httpData = await Http.post(HttpUrl.HOSPITAL_LIST_URL,
        data: data, isShowLoading: isShowLoading, loadingTitle: loadingTitle);
    return httpData;
  }

  /// 获取科室列表
  Future<HttpData> getDepartmentList(
      {dynamic data,
      bool isShowLoading = false,
      String loadingTitle = '加载中...'}) async {
    HttpData httpData = await Http.post(HttpUrl.DEPART_LIST_URL,
        data: data, isShowLoading: isShowLoading, loadingTitle: loadingTitle);
    return httpData;
  }

  /// 职务职称列表
  Future<HttpData> getDutyList(
      {dynamic data,
      bool isShowLoading = false,
      String loadingTitle = '加载中...'}) async {
    HttpData httpData = await Http.post(HttpUrl.DUTY_LIST_URL,
        data: data, isShowLoading: isShowLoading, loadingTitle: loadingTitle);

    return httpData;
  }

  /// 提交医生身份信息
  Future<HttpData> addDoctorInfo(
      {dynamic data,
      bool isShowLoading = true,
      String loadingTitle = '加载中...'}) async {
    HttpData httpData = await Http.post(HttpUrl.ADD_DR_URL,
        data: data, isShowLoading: isShowLoading, loadingTitle: loadingTitle);

    return httpData;
  }

  /// 更新医生在线状态
  Future<HttpData> updateDrState(
      {dynamic data,
      bool isShowLoading = false,
      String loadingTitle = '加载中...'}) async {
    HttpData httpData = await Http.post(HttpUrl.UPDATE_DR_STATE,
        data: data, isShowLoading: isShowLoading, loadingTitle: loadingTitle);
    return httpData;
  }

  /// 获取患者列表
  Future<HttpData> getPatientList(
      {dynamic data,
      bool isShowLoading = false,
      String loadingTitle = '加载中...',
      String baseUrl=""}) async {
    HttpData httpData = await Http.post(HttpUrl.PATIENT_LIST_URL,
        data: data, isShowLoading: isShowLoading, loadingTitle: loadingTitle);
    return httpData;
  }

  /// 获取患者详情
  Future<HttpData> getPatientDetail(
      {dynamic data,
      bool isShowLoading = true,
      String loadingTitle = '加载中...'}) async {
    HttpData httpData = await Http.post(HttpUrl.PATIENT_DETAIL_URL,
        data: data, isShowLoading: isShowLoading, loadingTitle: loadingTitle);
    return httpData;
  }

  /// 获取患者家庭成员表列表
  Future<HttpData> getPatientFamilyList(
      {dynamic data,
      bool isShowLoading = false,
      String loadingTitle = '加载中...'}) async {
    HttpData httpData = await Http.post(HttpUrl.PATIENT_FAMILY_LIST,
        data: data, isShowLoading: isShowLoading, loadingTitle: loadingTitle);
    return httpData;
  }

  /// 会话列表
  Future<HttpData> getChatMsgList(
      {dynamic data,
      bool isShowLoading = false,
      String loadingTitle = '加载中...'}) async {
    HttpData httpData = await Http.post(HttpUrl.CHAT_MSG_LIST,
        data: data, isShowLoading: isShowLoading, loadingTitle: loadingTitle);
    return httpData;
  }

  /// 患者聊天列表
  Future<HttpData> getPatientMsgList(
      {dynamic data,
      bool isShowLoading = false,
      String loadingTitle = '加载中...',String baseUrl=''}) async {
    HttpData httpData = await Http.post(baseUrl,
        data: data, isShowLoading: isShowLoading, loadingTitle: loadingTitle,baseUrl: baseUrl);
    return httpData;
  }

  /// 发送消息
  Future<HttpData> senMsgToPatient(
      {dynamic data,
      bool isShowLoading = false,
      String loadingTitle = '加载中...'}) async {
    HttpData httpData = await Http.post(
      HttpUrl.SEND_MSG_URL,
      data: data,
      isShowLoading: isShowLoading,
      loadingTitle: loadingTitle,
    );
    return httpData;
  }

  /// 校验身份信息
  Future validIDCardInfo({
    dynamic data,
    bool isShowLoading = false,
    String loadingTitle = '加载中...',
    String? baseUsr,
    Options? options,
  }) async {
    Map<String, dynamic> httpData = await Http.postMap(HttpUrl.ID_VALID,
        params: data,
        isShowLoading: isShowLoading,
        loadingTitle: loadingTitle,
        options: options,
        baseUrl: baseUsr);
    return httpData;
  }

  /// 获取单个用户信息
  Future<HttpData> getUserInfoByToken(
      {dynamic data,
      bool isShowLoading = false,
      String loadingTitle = '加载中...'}) async {
    HttpData httpData = await Http.post(HttpUrl.USER_INFO_ONE,
        data: data, isShowLoading: isShowLoading, loadingTitle: loadingTitle);
    return httpData;
  }

  //获取服务包列表
  Future<HttpData> getServicePackList(
      {dynamic data,
      bool isShowLoading = true,
      String loadingTitle = '加载中...'}) async {
    HttpData httpData = await Http.post(HttpUrl.SERVICE_PACK_LIST_URL,
        data: data, isShowLoading: isShowLoading, loadingTitle: loadingTitle);
    return httpData;
  }

  ///获取服务包详情
  Future<HttpData> getServicePackDetail(
      {dynamic data,
      bool isShowLoading = true,
      String loadingTitle = '加载中...'}) async {
    HttpData httpData = await Http.post(HttpUrl.SERVICE_PACK_DETAIL_URL,
        data: data, isShowLoading: isShowLoading, loadingTitle: loadingTitle);
    return httpData;
  }

  /// 我加入的团队
  Future<HttpData> getJointeamList(
      {dynamic data,
      bool isShowLoading = true,
      String loadingTitle = '加载中...'}) async {
    HttpData httpData = await Http.post(HttpUrl.JOIN_TEAM_URL,
        data: data, isShowLoading: isShowLoading, loadingTitle: loadingTitle);
    return httpData;
  }

  /// 团队详情
  Future<HttpData> getTeamDetail(
      {dynamic data,
      bool isShowLoading = true,
      String loadingTitle = '加载中...'}) async {
    HttpData httpData = await Http.post(HttpUrl.TEAM_DETAIL_URL,
        data: data, isShowLoading: isShowLoading, loadingTitle: loadingTitle);
    return httpData;
  }

  /// 团队成员
  Future<HttpData> getTeamMember(
      {dynamic data,
      bool isShowLoading = true,
      String loadingTitle = '加载中...'}) async {
    HttpData httpData = await Http.post(HttpUrl.TEAM_MEMBERL_URL,
        data: data, isShowLoading: isShowLoading, loadingTitle: loadingTitle);
    return httpData;
  }

  /// 我的关注 标题
  Future<HttpData> getArticleTitleList(
      {dynamic data,
      bool isShowLoading = false,
      String loadingTitle = '加载中...'}) async {
    HttpData httpData = await Http.post(HttpUrl.ARTICLE_TITLE_LIST,
        data: data, isShowLoading: isShowLoading, loadingTitle: loadingTitle);
    return httpData;
  }

  /// 文章列表
  Future<HttpData> getArticleList(
      {dynamic data,
      bool isShowLoading = false,
      String loadingTitle = '加载中...'}) async {
    HttpData httpData = await Http.post(HttpUrl.ARTICLE_LIST_URL,
        data: data, isShowLoading: isShowLoading, loadingTitle: loadingTitle);
    return httpData;
  }

  /// 文章详情
  Future<HttpData> getArticleDetail(
      {dynamic data,
      bool isShowLoading = false,
      String loadingTitle = '加载中...'}) async {
    HttpData httpData = await Http.post(HttpUrl.ARTICLE_DETAIL_URL,
        data: data, isShowLoading: isShowLoading, loadingTitle: loadingTitle);
    return httpData;
  }

  /// 添加常用语句
  Future<HttpData> addPhrase(
      {dynamic data,
      bool isShowLoading = false,
      String loadingTitle = '加载中...'}) async {
    HttpData httpData = await Http.post(HttpUrl.PHRASES_ADD,
        data: data, isShowLoading: isShowLoading, loadingTitle: loadingTitle);
    return httpData;
  }

  /// 获取常用语句列表
  Future<HttpData> getPhraseList(
      {dynamic data,
      bool isShowLoading = false,
      String loadingTitle = '加载中...'}) async {
    HttpData httpData = await Http.post(HttpUrl.PHRASES_LIST,
        data: data, isShowLoading: isShowLoading, loadingTitle: loadingTitle);
    return httpData;
  }

  /// 获取排班列表
  Future<HttpData> getPaiBanList(
      {dynamic data,
      bool isShowLoading = false,
      String loadingTitle = '加载中...'}) async {
    HttpData httpData = await Http.post(HttpUrl.SERVICE_PAIBAN_LST,
        data: data, isShowLoading: isShowLoading, loadingTitle: loadingTitle);
    return httpData;
  }

  /// 反馈意见
  Future<HttpData> postFeedBack(
      {dynamic data,
      bool isShowLoading = true,
      String loadingTitle = '加载中...'}) async {
    HttpData httpData = await Http.post(HttpUrl.FEEDBACK_URL,
        data: data, isShowLoading: isShowLoading, loadingTitle: loadingTitle);
    return httpData;
  }

  /// 排班服务详情
  Future<HttpData> serverDetail(
      {dynamic data,
      bool isShowLoading = true,
      String loadingTitle = '加载中...'}) async {
    HttpData httpData = await Http.post(HttpUrl.SERVER_DETAIL_URL,
        data: data, isShowLoading: isShowLoading, loadingTitle: loadingTitle);
    return httpData;
  }

  /// 评价列表
  Future<HttpData> getEvaluateList(
      {dynamic data,
      bool isShowLoading = false,
      String loadingTitle = '加载中...'}) async {
    HttpData httpData = await Http.post(HttpUrl.EVALUATE_LIST_URL,
        data: data, isShowLoading: isShowLoading, loadingTitle: loadingTitle);
    return httpData;
  }

  /// 回复评价
  Future<HttpData> replyEvaluate(
      {dynamic data,
      bool isShowLoading = false,
      String loadingTitle = '加载中...'}) async {
    HttpData httpData = await Http.post(HttpUrl.EVALUATE_RELAY_URL,
        data: data, isShowLoading: isShowLoading, loadingTitle: loadingTitle);
    return httpData;
  }

  /// 签约管理
  Future<HttpData> getSignManager(
      {dynamic data,
      bool isShowLoading = true,
      String loadingTitle = '加载中...'}) async {
    HttpData httpData = await Http.post(HttpUrl.SIGN_MANAGER_URL,
        data: data, isShowLoading: isShowLoading, loadingTitle: loadingTitle);
    return httpData;
  }

  /// 签约详情
  Future<HttpData> getSignDetail(
      {dynamic data,
      bool isShowLoading = false,
      String loadingTitle = '加载中...'}) async {
    HttpData httpData = await Http.post(HttpUrl.SIGN_MANAGER_DETAIL_URL,
        data: data, isShowLoading: isShowLoading, loadingTitle: loadingTitle);
    return httpData;
  }

  /// 修改密码
  Future<HttpData> resetPwd(
      {dynamic data,
      bool isShowLoading = true,
      String loadingTitle = '加载中...'}) async {
    HttpData httpData = await Http.post(HttpUrl.RESET_PWD_URL,
        data: data, isShowLoading: isShowLoading, loadingTitle: loadingTitle);
    return httpData;
  }

  /// 家庭医护
  Future<HttpData> getfamilyList(
      {dynamic data,
      bool isShowLoading = true,
      String loadingTitle = '加载中...'}) async {
    HttpData httpData = await Http.post(HttpUrl.FAMYLI_URL,
        data: data, isShowLoading: isShowLoading, loadingTitle: loadingTitle);
    return httpData;
  }

  /// 家庭医护详情
  Future<HttpData> getfamilyDetail(
      {dynamic data,
      bool isShowLoading = true,
      String loadingTitle = '加载中...'}) async {
    HttpData httpData = await Http.post(HttpUrl.FAMYLI_DETAIL_URL,
        data: data, isShowLoading: isShowLoading, loadingTitle: loadingTitle);
    return httpData;
  }

  /// 生成小程序二维码
  Future<HttpData> getQrCode(
      {dynamic data,
      bool isShowLoading = false,
      String loadingTitle = '加载中...'}) async {
    HttpData httpData = await Http.post(HttpUrl.TEAM_QRCODE_URL,
        data: data, isShowLoading: isShowLoading, loadingTitle: loadingTitle);
    return httpData;
  }

  /// 黑名单列表
  Future<HttpData> getBlackList(
      {dynamic data,
      bool isShowLoading = false,
      String loadingTitle = '加载中...'}) async {
    HttpData httpData = await Http.post(HttpUrl.BLACK_LIST_URL,
        data: data, isShowLoading: isShowLoading, loadingTitle: loadingTitle);
    return httpData;
  }

  /// 添加服务包详情 血压测量数据
  Future<HttpData> addServerPressData(
      {dynamic data,
      bool isShowLoading = false,
      String loadingTitle = '加载中...'}) async {
    HttpData httpData = await Http.post(HttpUrl.SERVER_ADD_PRESS_URL,
        data: data, isShowLoading: isShowLoading, loadingTitle: loadingTitle);
    return httpData;
  }

  /// 添加服务包详情 血糖测量数据
  Future<HttpData> addServerSugarData(
      {dynamic data,
      bool isShowLoading = false,
      String loadingTitle = '加载中...'}) async {
    HttpData httpData = await Http.post(HttpUrl.SERVER_ADD_SUGAR_URL,
        data: data, isShowLoading: isShowLoading, loadingTitle: loadingTitle);
    return httpData;
  }

  /// 添加服务包详情 体重测量数据
  Future<HttpData> addServerWeightData(
      {dynamic data,
      bool isShowLoading = false,
      String loadingTitle = '加载中...'}) async {
    HttpData httpData = await Http.post(HttpUrl.SERVER_ADD_WEIGHT_URL,
        data: data, isShowLoading: isShowLoading, loadingTitle: loadingTitle);
    return httpData;
  }

  /// 添加服务包详情 体重测量数据
  Future<HttpData> addServerFatData(
      {dynamic data,
      bool isShowLoading = false,
      String loadingTitle = '加载中...'}) async {
    HttpData httpData = await Http.post(HttpUrl.SERVER_ADD_FAT_URL,
        data: data, isShowLoading: isShowLoading, loadingTitle: loadingTitle);
    return httpData;
  }

  /// 添加服务包详情 其他测量数据
  Future<HttpData> addServerOthertData(
      {dynamic data,
      bool isShowLoading = false,
      required String checkName,
      String loadingTitle = '加载中...'}) async {
    HttpData httpData = await Http.post(
        HttpUrl.SERVER_ADD_OTHER_URL + checkName,
        data: data,
        isShowLoading: isShowLoading,
        loadingTitle: loadingTitle);
    return httpData;
  }

  /// 更新服务包状态
  Future<HttpData> updateServerStatus(
      {dynamic data,
      bool isShowLoading = false,
      String loadingTitle = '加载中...'}) async {
    HttpData httpData = await Http.post(HttpUrl.UPDATE_SERVER_STATUS,
        data: data, isShowLoading: isShowLoading, loadingTitle: loadingTitle);
    return httpData;
  }

  /// 更新医生信息
  Future<HttpData> updateDrInfo(
      {dynamic data,
      bool isShowLoading = false,
      String loadingTitle = '加载中...'}) async {
    HttpData httpData = await Http.post(HttpUrl.UPDATE_DR_INFO,
        data: data, isShowLoading: isShowLoading, loadingTitle: loadingTitle);
    return httpData;
  }

  /// 搜索药品名称
  Future<HttpData> searchDrugName(
      {dynamic data,
      bool isShowLoading = true,
      String loadingTitle = '加载中...'}) async {
    HttpData httpData = await Http.post(HttpUrl.DRUG_NAME_LIST,
        data: data, isShowLoading: isShowLoading, loadingTitle: loadingTitle);
    return httpData;
  }

  /// 开处方
  Future<HttpData> addPresc(
      {dynamic data,
      bool isShowLoading = true,
      String loadingTitle = '加载中...'}) async {
    HttpData httpData = await Http.post(HttpUrl.ADD_PRESC,
        data: data, isShowLoading: isShowLoading, loadingTitle: loadingTitle);
    return httpData;
  }

  /// 处方列表
  Future<HttpData> getPrescList(
      {dynamic data,
      bool isShowLoading = true,
      String loadingTitle = '加载中...'}) async {
    HttpData httpData = await Http.post(HttpUrl.PRESC_LIST_URL,
        data: data, isShowLoading: isShowLoading, loadingTitle: loadingTitle);
    return httpData;
  }

  /// 处方详情
  Future<HttpData> getPrescDetail(
      {dynamic data,
      bool isShowLoading = true,
      String loadingTitle = '加载中...'}) async {
    HttpData httpData = await Http.post(HttpUrl.PRESC_DETAIL_URL,
        data: data, isShowLoading: isShowLoading, loadingTitle: loadingTitle);
    return httpData;
  }

  /// 耗材列表
  Future<HttpData> getConsumableList(
      {dynamic data,
      bool isShowLoading = true,
      String loadingTitle = '加载中...'}) async {
    HttpData httpData = await Http.post(HttpUrl.CONSUMABLE_LIST_URL,
        data: data, isShowLoading: isShowLoading, loadingTitle: loadingTitle);
    return httpData;
  }

  /// 添加患者耗材
  Future<HttpData> addConsumable(
      {dynamic data,
      bool isShowLoading = true,
      String loadingTitle = '加载中...'}) async {
    HttpData httpData = await Http.post(HttpUrl.CONSUMABLE_ADD_URL,
        data: data, isShowLoading: isShowLoading, loadingTitle: loadingTitle);
    return httpData;
  }

  /// 单个患者服务单列表
  Future<HttpData> getPatientOrderList(
      {dynamic data,
      bool isShowLoading = true,
      String loadingTitle = '加载中...'}) async {
    HttpData httpData = await Http.post(HttpUrl.PATIENT_ORDER_LIST_URL,
        data: data, isShowLoading: isShowLoading, loadingTitle: loadingTitle);
    return httpData;
  }

  /// 随访列表
  Future<HttpData> getSuiFangList(
      {dynamic data,
      bool isShowLoading = false,
      String loadingTitle = '加载中...'}) async {
    HttpData httpData = await Http.post(HttpUrl.SUIFANG_LIST_URL,
        data: data, isShowLoading: isShowLoading, loadingTitle: loadingTitle);
    return httpData;
  }

  /// 随访详情
  Future<HttpData> getSuiFangDetail(
      {dynamic data,
      bool isShowLoading = false,
      String loadingTitle = '加载中...'}) async {
    HttpData httpData = await Http.post(HttpUrl.SUIFANG_DETAIL_URL,
        data: data, isShowLoading: isShowLoading, loadingTitle: loadingTitle);
    return httpData;
  }

  /// 回访列表
  Future<HttpData> getHuiFangList(
      {dynamic data,
      bool isShowLoading = false,
      String loadingTitle = '加载中...'}) async {
    HttpData httpData = await Http.post(HttpUrl.HUIFANG_LIST_URL,
        data: data, isShowLoading: isShowLoading, loadingTitle: loadingTitle);
    return httpData;
  }

  /// 随回访详情
  Future<HttpData> getHuiFangDetail(
      {dynamic data,
      bool isShowLoading = false,
      String loadingTitle = '加载中...'}) async {
    HttpData httpData = await Http.post(HttpUrl.HUIFANG_DETAIL_URL,
        data: data, isShowLoading: isShowLoading, loadingTitle: loadingTitle);
    return httpData;
  }

  /// 复诊规划列表
  Future<HttpData> getFollowDuanosisList(
      {dynamic data,
      bool isShowLoading = false,
      String loadingTitle = '加载中...'}) async {
    HttpData httpData = await Http.post(HttpUrl.FOLLOW_DIAGNOSIS_LIST_URL,
        data: data, isShowLoading: isShowLoading, loadingTitle: loadingTitle);
    return httpData;
  }

  /// 复诊规划详情
  Future<HttpData> getFollowDuanosisDetail(
      {dynamic data,
      bool isShowLoading = false,
      String loadingTitle = '加载中...'}) async {
    HttpData httpData = await Http.post(HttpUrl.FOLLOW_DIAGNOSIS_DETAIL_URL,
        data: data, isShowLoading: isShowLoading, loadingTitle: loadingTitle);
    return httpData;
  }

  /// 签约详情操作
  Future<HttpData> signOperatate(
      {dynamic data,
      bool isShowLoading = false,
      String loadingTitle = '加载中...'}) async {
    HttpData httpData = await Http.post(HttpUrl.SIGN_OPERATATE_URL,
        data: data, isShowLoading: isShowLoading, loadingTitle: loadingTitle);
    return httpData;
  }

  // 更新团队信息
  Future<HttpData> updateTeamInfo(
      {dynamic data,
      bool isShowLoading = false,
      String loadingTitle = '加载中...'}) async {
    HttpData httpData = await Http.post(HttpUrl.UPDATE_TEAM_INFO_URL,
        data: data, isShowLoading: isShowLoading, loadingTitle: loadingTitle);
    return httpData;
  }

  // 申请加入团队
  Future<HttpData> applyJoinTeam(
      {dynamic data,
      bool isShowLoading = false,
      String loadingTitle = '加载中...'}) async {
    HttpData httpData = await Http.post(HttpUrl.APPLY_JOIN_TEAM_URL,
        data: data, isShowLoading: isShowLoading, loadingTitle: loadingTitle);
    return httpData;
  }
}
